import { createStore } from 'vuex';
import CreatePersistedState from 'vuex-persistedstate';
import { common } from './modules/common';

const persistedstate = CreatePersistedState({
  key: 'retail-store-app',
  paths: ['common'],
});

const store = createStore({
  strict: true,
  modules: {
    common,
  },
  plugins: [persistedstate],
});

export const setupStore = app => {
  app.use(store);
};

export default store;
